package com.nchu.dto;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDto {
    //校验
    @NotNull(message = "用户ID不能为空!")
    private Integer id;

    @NotNull(message = "用户名不能为空！")
    @Size(min = 6, max = 20, message = "用户名长度必须在6到20个字符之间")
    private String username;

    @NotNull(message = "电话号码不能为空！")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话不符合规范！")
    private String phone;
}
